#
# @lc app=leetcode.cn id=28 lang=python3
#
# [28] 找出字符串中第一个匹配项的下标
#

# @lc code=start
class Solution:
    def strStr(self, haystack: str, needle: str) -> int:
        if needle not in haystack:
            return -1
        needle_length=len(needle)
        for i in range(len(haystack)):
            if haystack[i]==needle[0]:
                empty_str=''
                for j in range(i,i+needle_length):
                    empty_str+=haystack[j]
                if empty_str == needle:
                    return i
                else:
                    continue
            
            
# @lc code=end

